<template>
  <view>
    <uni-list :border="false">
      <uni-list-item
          :border="false"
          style="background-color: #f5f6f7"
          v-for="storeApply in applyList" :key="storeApply.applyId"
          :title="storeApply.shopName"
          :note="storeApply.shopUrl+storeApply.shopAddress"
          :thumb="storeApply.shopELicense"
          thumb-size="lg"
          :right-text="storeApply.corporateName"
          :show-arrow="false"
          direction="row"
          clickable
          @click="onclickItem(storeApply)"
      ></uni-list-item>
    </uni-list>
    <uni-row>
      <uni-col :span="12" :push="6">
        <uni-pagination
            style="margin-top: 20px"
            v-model="queryParams.pageNum"
            :total="total"
            :page-size="9"
            @change="change"
        ></uni-pagination>
      </uni-col>
    </uni-row>
  </view>
</template>

<script>
import { listApply } from "@/api/shop/apply"
import UniList from "../../../../../uni_modules/uni-list/components/uni-list/uni-list";
import UniPagination from "../../../../../uni_modules/uni-pagination/components/uni-pagination/uni-pagination";
import UniSearchBar from "../../../../../uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar";
import UniListItem from "../../../../../uni_modules/uni-list/components/uni-list-item/uni-list-item";
import UniCol from "../../../../../uni_modules/uni-row/components/uni-col/uni-col";
import UniRow from "../../../../../uni_modules/uni-row/components/uni-row/uni-row";
export default {
  components: {UniRow, UniCol, UniListItem, UniSearchBar, UniPagination, UniList},
  data() {
    return {
      //店铺状态字典
      shopStatus: ["", "运营中", "审核中", "已关闭", "审核不通过"],
      //分页器数据
      total:0,
      //店铺审核数据列表表格数据
      applyList: [],
      //分页请求参数
      queryParams:{
        pageNum: 1,
        pageSize: 9,
        //按创建时间倒序查询
        orderByColumn: "apply_id",
        isAsc: "asc",
      }
    }
  },
  mounted() {
    this.getStoreApply();
  },
  methods: {
    /**跳转店铺详情页*/
    onclickItem(storeApply) {
      uni.navigateTo({
        url: `apply/showApply?storeApply=${JSON.stringify(storeApply)}`,
      });
    },
    /**查询店铺审核列表*/
    getStoreApply() {
      listApply(this.queryParams).then(response => {
        this.applyList = response.rows;
        this.total = response.total;
      });
    },
    /**翻页查询*/
    change(e) {
      this.queryParams.pageNum = e.current;
      this.getStoreApply();
    },
  }
}
</script>

<style></style>